version: "2"

services:
  fiscobcos:
    image: {{ nexus_docker_proxy | default('') }}fiscoorg/fiscobcos:{{ fb_version }}
    container_name: fisco-bcos-{{ node_port }}
    hostname: fisco-bcos-{{ node_port }}
    restart: always
    network_mode: host
    labels:
      fisco-bcos.agency.name: "{{ agency.cn_name | default(agency.en_name) }}"
      fisco-bcos.agency.node: "{{ node_host }}:{{ node_port }}"
    working_dir: /opt/fisco-bcos
    volumes:
      - ".:/opt/fisco-bcos"
    command:
      - -c
      - /opt/fisco-bcos/config.ini

  logrotate:
    image: fiscobcos-sidecar
    container_name: fisco-bcos-logrotate-{{ node_port }}
    hostname: fisco-bcos-logrotate-{{ node_port }}
    restart: always
    build:
      context: ./container_config
      dockerfile: Dockerfile-sidecar
    volumes:
      - "./log:/var/log/fiscobcos"
      - "./container_config/docker-logrotate.conf:/etc/logrotate.d/fiscobcos"
    entrypoint:
      - /usr/sbin/crond
      - -n
    depends_on:
      - fiscobcos